package com.gepengjun.lims.entity;

import com.baomidou.mybatisplus.enums.IdType;
import java.util.Date;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.enums.IdType;
import com.baomidou.mybatisplus.activerecord.Model;
import java.io.Serializable;
import java.util.List;

/**
 * <p>
 * 
 * </p>
 *
 * @author jun
 * @since 2018-09-07
 */
public class Permission extends Model<Permission> {

    private static final long serialVersionUID = 1L;

    @TableId(value = "permission_id", type = IdType.AUTO)
    private Long permissionId;
    @TableField("permission_name")
    private String permissionName;
    private Boolean available;
    @TableField("source_type")
    private String sourceType;
    @TableField("permission_str")
    private String permissionStr;
    private String url;
    @TableField("parent_id")
    private Long parentId;
    @TableField("parent_ids")
    private String parentIds;
    @TableField("last_upd_user")
    private Long lastUpdUser;
    @TableField("last_upd_time")
    private Date lastUpdTime;
    private String remark;

    /**前台属性  begin**/
    @TableField(exist = false)
    private Permission parent;
    @TableField(exist = false)
    private List<Permission> children;
    /**前台属性  end**/

    public Long getPermissionId() {
        return permissionId;
    }

    public Permission setPermissionId(Long permissionId) {
        this.permissionId = permissionId;
        return this;
    }

    public String getPermissionName() {
        return permissionName;
    }

    public Permission setPermissionName(String permissionName) {
        this.permissionName = permissionName;
        return this;
    }

    public Boolean getAvailable() {
        return available;
    }

    public Permission setAvailable(Boolean available) {
        this.available = available;
        return this;
    }

    public String getSourceType() {
        return sourceType;
    }

    public Permission setSourceType(String sourceType) {
        this.sourceType = sourceType;
        return this;
    }

    public String getPermissionStr() {
        return permissionStr;
    }

    public Permission setPermissionStr(String permissionStr) {
        this.permissionStr = permissionStr;
        return this;
    }

    public String getUrl() {
        return url;
    }

    public Permission setUrl(String url) {
        this.url = url;
        return this;
    }

    public Long getParentId() {
        return parentId;
    }

    public Permission setParentId(Long parentId) {
        this.parentId = parentId;
        return this;
    }

    public String getParentIds() {
        return parentIds;
    }

    public Permission setParentIds(String parentIds) {
        this.parentIds = parentIds;
        return this;
    }

    public Long getLastUpdUser() {
        return lastUpdUser;
    }

    public Permission setLastUpdUser(Long lastUpdUser) {
        this.lastUpdUser = lastUpdUser;
        return this;
    }

    public Date getLastUpdTime() {
        return lastUpdTime;
    }

    public Permission setLastUpdTime(Date lastUpdTime) {
        this.lastUpdTime = lastUpdTime;
        return this;
    }

    public String getRemark() {
        return remark;
    }

    public Permission setRemark(String remark) {
        this.remark = remark;
        return this;
    }

    @Override
    protected Serializable pkVal() {
        return this.permissionId;
    }

    public Permission getParent() {
        return parent;
    }

    public void setParent(Permission parent) {
        this.parent = parent;
    }

    public List<Permission> getChildren() {
        return children;
    }

    public void setChildren(List<Permission> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "Permission{" +
        "permissionId=" + permissionId +
        ", permissionName=" + permissionName +
        ", available=" + available +
        ", sourceType=" + sourceType +
        ", permissionStr=" + permissionStr +
        ", url=" + url +
        ", parentId=" + parentId +
        ", parentIds=" + parentIds +
        ", lastUpdUser=" + lastUpdUser +
        ", lastUpdTime=" + lastUpdTime +
        ", remark=" + remark +
        "}";
    }
}
